//*****************************************************************
//   Converting Single Player Maps To MultiPlayer by Cobra {SFX}
//*****************************************************************


Ive seen a lot of posts claiming SP to MP - the answer is HERE

The answer to SP-MP is 3 IMPORTANT things:


1. A MULTIPLAYER START-UP SCRIPT

2. THE AI PLAYERS REMOVED

3. MULTIPLAYER SPAWNPOINTS ADDED


The prefab script below supplies you with all 3!!!

anything after that is a bonus :)  Read on ...







Heres what you are going to need:

Pakscape (for opening/creating/saving A pk3 File)

NotePad ( For Opening Script Files )


Once you have got pakscape, run it and go to your MOHAA/Main folder and 
you will seethe games PK3 files, if you open pak5 you will find the Single 
Player and MultiPlayer maps.

Example of what to do now...

Copy the script file of the map you want to do to your desktop 
(eg copy M5L1B.scr to your desktop)

Now run Notepad and go to load (change file type to all Types) and load 
the M5L1B.scr

Now as is, it will not run in MultiPlayer, here is a "prefab" you can 
use and compare to the original,

Note - this is already set up for M5L1B, to test just copy everything between the 

top //*********


and the bottom //**********


and paste it into a NEW notepad window, then save it in your 
Mohaa/Main/Maps folder, make sure you call it M5L1B.scr 
(eg  MOHAA/Main/Maps/M5L1B.scr )




//********************************************************************
// Start of PreFab



main:

setcvar "g_obj_alliedtext1"     "Map Name Here" // Your Maps Name/Whatever
setcvar "g_obj_alliedtext2"   ""
setcvar "g_obj_alliedtext3"      "by"
setcvar "g_obj_axistext1"     ""
setcvar "g_obj_axistext2"   ""
setcvar "g_obj_axistext3"   "www.mods-r-us.net"

setcvar "g_scoreboardpic" "m5l1a" // A Scoreboard Pic

setcvar "g_gametype" "2" // your chosen gametype
setcvar "fraglimit" "0"
setcvar "timelimit" "10" // 10 mins map time outta do

level.clockside=kills //  Highest Team With Kills Wins
	

level.script = maps/m5l1b.scr // your maps scripts name


waitthread spawns // Gonna need this 

removeclass Actor // This Line Removes the AI Actors


level waittill prespawn


level waittill spawn

end


spawns:

local.axis = spawn info_player_axis
local.axis.angle = 144
local.axis.origin = ( 1310 -1630 489 )

local.axis = spawn info_player_axis
local.axis.angle = -96
local.axis.origin = ( 1730 -1128 469 )

local.axis = spawn info_player_axis
local.axis.angle = 144
local.axis.origin = ( 2378 -726 549 )

local.axis = spawn info_player_axis
local.axis.angle = 123
local.axis.origin = ( 2402 -1239 443 )

local.axis = spawn info_player_axis
local.axis.angle = 177
local.axis.origin = ( 2693 -544 497 )

local.axis = spawn info_player_axis
local.axis.angle = -89
local.axis.origin = ( 3303 394 534 )

local.axis = spawn info_player_axis
local.axis.angle = -8
local.axis.origin = ( 2897 -1498 494 )

local.axis = spawn info_player_axis
local.axis.angle = -2
local.axis.origin = ( 3275 -1210 433 )

local.axis = spawn info_player_axis
local.axis.angle = 84 
local.axis.origin = ( 3740 -435 433 )

local.axis = spawn info_player_axis
local.axis.angle = 94
local.axis.origin = ( 3737 -88 433 )


local.allies = spawn info_player_allied
local.allies.angle = -9
local.allies.origin = ( -3724 -3775 230 )

local.allies = spawn info_player_allied
local.allies.angle = -4
local.allies.origin = ( -3221 -3915 190 )

local.allies = spawn info_player_allied
local.allies.angle = 0
local.allies.origin = ( -3203 -4380 190 )
 
local.allies = spawn info_player_allied
local.allies.angle = -31
local.allies.origin = ( -2814 -4248 190 )

local.allies = spawn info_player_allied
local.allies.angle = -19
local.allies.origin = ( -2609 -4874 143 )

local.allies = spawn info_player_allied
local.allies.angle = 17
local.allies.origin = ( -2420 -4331 164 )

local.allies = spawn info_player_allied
local.allies.angle = 12
local.allies.origin = ( -2046 -3683 268 )
 
local.allies = spawn info_player_allied
local.allies.angle = -10
local.allies.origin = ( -2101 -5063 146 )

local.allies = spawn info_player_allied
local.allies.angle = -0
local.allies.origin = ( -2187 -5306 146 )

local.allies = spawn info_player_allied
local.allies.angle = -42
local.allies.origin = ( -2159 -4750 240 )

end

// End of PreFab
//*****************************************************************************






NOTE - we NEVER save anything back into any of our original PK3 files, 
you can copy from them but NEVER save into them. 

Also we need to test things 
before considering making a PK3 file for server use so we know there isnt going 
to be any problems/crashes serverside.


To edit the maps script file we need it in our Mohaa/Main/Maps folder so we 
can make changes and load the game up and make sure everythings working how we want 
it to.

Anyway - 

Put that M5L1B.scr in main/maps folder and load up Mohaa and bring 
console down (the tilde key ` ) and type map m5l1b and hit enter 

You should then be able to run around that map same as you do on the stock 
multiplayer maps.


Now i called this a prefab, simply rename the M5L1B.scr in your main/maps folder
that you just tested to another Single Player Map to Test That Map

eg... rename M5L1B.scr to M4L3.scr and Load Mohaa Again and in console load that 
map (map m4l3 enter)

Now Youll Notice The Spawns Arent right as theyre from M5L1Bs map, You can sometimes 
spawn in the map and manage to go looking around, if not you can still use spectate 
to look around the map.

what you are going to have to do is add new spawnpoints for where you want the 
players to start when they join a team. 
(this applies to every Single Player map you intend to mod)

So... Ingame you need to decide where you want players to spawn, seeing as this 
script is setup for gametype 2 (TDM), i would select one side of a map for the first
team and the other side of the map for the second team.

Heres what you do, stand facing the direction you want the player to face when he 
spawns and from the location you want him to spawn from, and open console ( ` )
and type coord console will return the coordinates of the map your standing in 
and the angles your facing....

eg 

type coord 

console returns with the info you requested 

location: 5877.67 -4503.13 208.13 
angles: 10.43 82.34 0.00
(use 'tele' or 'face' to set)


So you write down the location and the angle for your first spawnpoint, the bits 
that interest us are

5877 -4503 208  *** notice you dont need the decimal point and extra numbers ***

82 *** The angle we require is the middle set - decimal and extra numbers discard ***


once youve ran around that teams area repeating that 10 times and obtaining 
the needed coords, do the same for the opposite team. You should end up with 
20 sets of coords and angles

Then editing the ones in your "prefab" add the spawnpoints to each teams, 
save in the same maps folder and overwrite the one thats in there then go and test 
ingame.


That covers basic Converting, you will find some maps will need work to make 
more usable, there are a lot of bottlenecks, items you may want to remove, items 
you can move around for better use, spawn new items in, there are lots of options 
at your disposal.


You are going to find players can get under the map, there are some things you need 
to remove, you will need to block them from going places you dont want them to, 
in other words there is still some work to do after adding spawnpoints, you may want to 
enable some of the old objectives.
(heres where you get creative and build something really nice for your server)!


Every Single Player Conversion is going to need fixes for something or other but 
thats what forums are for and i KNOW you will learn from making your Conversion and 
should enjoy it! If you arent enjoying it then id change to doing something else lol.


Once all the fixes have been done (with help from forums,friends etc ...) and you 
are satisfied its ready for server use...

open pakscape, click new and in the right window right click and go to OBJECT 
and select NEW DIRECTORY, name it maps and hit enter, now go to your 
mohaa/main/maps folder and copy your script file to the maps folder in Pakscape

(eg copy your M5L1B.scr to the maps folder in Pakscape)
then in Pakscape click 

File

Save As

make sure its going to save in your Mohaa/Main folder at the top

click save as type and change it to read Quake 3 Pak (*.PK3)


In the filename type your choice of name for the mod

(eg zzzz_my_m5l1b) and hit save

You will now have your Converted map in pk3 format ready to upload to your 
servers main folder

:)


Compare your M5L1B prefab to the M5L1B i made thats in our Mod Files section at 
www.Mods-R-us.net

youll see how i removed certain things and also added some.



******************************
For SpearHead and breakThrough
******************************


For SpearHead and BreakThrough roughly the same applies except you have to 
test your "prefab" from within a PK3
(eg make your pk3 file with the maps folder and place your selected "prefab" inside  

eg..


SpearHead...
make a T1L3.scr prefab from the one above and in pakscape make your maps folder 
as explained above and paste your T1L3.scr prefab in and save in your 
Spearhead - Mainta folder and load up SpearHead and do the same in console - 
map T1L3 and hit enter


BreakThrough...
make a E1L1.scr prefab from the one above and in pakscape make your maps folder 
as explained above and paste your E1L1.scr prefab in and save in your 
BreakThrough - Maintt folder and load up SH/BT and do the same in console - 
map E1L1 and hit enter


You will have a few things to add before you start becoming happy with it but thats
part of the fun, you will learn a lot from the SP scripts :)


Advice: ALWAYS look through the original script file as it will have a lot of 
information you will need, also the other scripts that it executes/threads to from
within the main script.


once you get the hang of it and thirst for more i recommend some extra tools 
be used to help you ...


MohRadiant (used for looking at .map files and making your own maps 
if you ever decide to take up mapping)


MohBSPtoMohMAP - a handy tool for converting the BSP files in your pak5 
to a .map format, you would then use MohRadiant to load the .map and you can look 
around inside the map and retrieve quite a lot of information that you will probably 
help you when converting SP maps, eg the targetnames of certain items 
you may want to enable (like a tank for example) or a flightpath.


MohaaTools made by scorpio Midget is another handy prog, This can load the BSp 
and give you a lot of information including a 3d browser to look around the map.


M2S map to script converter provides you with a targetnames list and some 
nice options for scripting things in for you. 
available here...  http://www.alienxsoftware.co.uk/


SorridStrokers SpawnCreate - makes adding spawnpoints a doddle :)


EditPlus is a nice program for scripting 







You will come across some maps where the removeclass actor doesnt remove 
all the AI players, you will need to remove them by their targetname 
(some homework there for you when you come across them) :P


Every map is different to do, so begins your quest!


This is a handy thing to have in your Mohaa shortcut 

+set developer 1 +set thereisnomonkey 1 +set cheats 1

copy that and right click your Mohaa shortcut on your desktop and add it to the target

eg should look something like this

C:\Program Files\EaGames\MOHAA\MOHAA.exe +set developer 1 +set thereisnomonkey 1 +set cheats 1
click apply and click ok

This will give you better access to things in console and ingame.
(no you cant cheat in a multiplayer game unless the server allows you to
but when testing your conversion you can use noclip to look around etc)

eg in console type noclip and hit enter
you can now "float" around your map, quicker than running also ;)
to land simply repeat what you typed - in console type noclip and hit enter



What to do when something you have added isnt showing ingame....

As soon as you enter the game and your item isnt there open console and use 
page up, you are looking for a line that is pointing out a problem.

Nothing there? type restart and look again.


Console will show you the problem and point straight to the fault using ^
eg...

 local.crate.horigin = ( blah blah blah)
script error ^


(in other words look for the ^ pointing the problem/s out)
Console is your best friend - USE IT!


Before you load your map you can also type in console logfile 2 then load the map
Using logfile will create a qconsole file in your main folder, test things ingame and then
quit, go to your main (or mainta / maintt if in SH or BT) and double click the qconsole


You should have a list of errors, things the map cant find etc.
Your primary task is to fix anything youve added thats being highlighted in qconsole.
Some of the other errors in there can also be fixed.
(Each map will have its own unique set of errors)


All we can do is fix what we can, a lot of the errors will be linked with the 
Single Player map that it once was (cant find triggers, etc etc)


LOCALIZATION ERROR: '{SFX} Shock + Awe-M1L2A' does not have a localization entry

Localization errors can be ignored (theyre just saying the text isnt standard but will run ok)
(if youve added text / ingame messages youll see that error in console - ignore them.


Alias errors..  Sounds ingame will need an alias, youll find quite a few sounds dont work,
some we can fix, other we are still looking for a fix for. Namely some of the weapons.


ERROR PlaySound: bar_snd_reload needs an alias in ubersound.scr or uberdialog.scr - Please fix.
Another missing weapon sound


Your maps precache will be found in the pak that you took the original script file from
eg M5L1B_precache.scr  (yes copy that to your pk3 alongside your prefab of M5L1B)
Same applies to any map you do - make sure it has its precache in your pk3s maps folder.


If youve added a model that wasnt in the SP map then you should add it to the maps precache
or any that you find in your qconsole that you know youve added via script


example - i added a p47 flying and now i see that error in console...


^~^~^ Add the following line to the *_precache.scr map script:
cache models/vehicles/p47fly.tik


(just copy and paste "cache models/vehicles/p47fly.tik" to your maps precache)
(keep a copy of the precache.scr on your desktop and add to it, when finished add the new
precache to your pk3s maps folder alongside your map script)






REMOVECLASS

you are going to be using the removeclass command a bit, these need to be used 
BEFORE level waittill prespawn


some info...

removeclass actor // removes most/all of the AI players
removeclass trigger // removes original triggers 


I recommend using the above 2 in every script as we need to remove the AI and remove
the triggers the single player game used for saving etc


New triggers can be added in the usual way and threaded to after the removeclass has been used
from the usual place (inbetween level waittill prespawn and level waittill spawn)


(Look at my M5L1B.scr to see how i removed triggers and added new ones)


If you ever need to know somethings class, look in PAK 0 in the models list and
find its TIK file, double click to look at its info.







SETSIZE ..
You will be using setsize when adding triggers and some other things, there is a good explanation of 
setsize in the scripting forum)



See you on the Forums



Cobra {SFX}



Ps If ive missed anything dont worry ill remember and add it lol!





































